package org.xiaoyu.rpc;

import java.util.Map;

/**
 * Created By Have
 * 2021/7/12 20:47
 */
public class RpcExporter<T> extends AbstractExporter<T> {
    private final String key;
    private final Map<String, Exporter<?>> exporterMap;

    public RpcExporter(Invoker<T> invoker, String key, Map<String, Exporter<?>> exporterMap) {
        super(invoker);
        this.key = key;
        this.exporterMap = exporterMap;
    }

    @Override
    public void afterUnExport() {
        this.exporterMap.remove(key);
    }
}
